import "../css/common.css"
import "../css/animate.min.css"
import "../css/swiper.min.css"
import "../utils/font_3632582_1592zyc9upth/iconfont.css"

let go = document.querySelector(".go>.up")
let box = document.querySelector(".go")

go.addEventListener("click",()=>{
    window.scrollTo(
        {
            top: 0,
            behavior: 'smooth',
        }
    )
})

window.onscroll = function () {
    //设置滚动条触发事件
    var scrollTop = document.documentElement.scrollTop || document.body.scroll;//定义一个变量处理卷去高度的两种情况
    if (scrollTop >= 300) {
        //当滚动条>=300时，go盒子出现，顶部盒子在页面最顶部
        go.style.opacity = 1;
    } else {
        //当滚动条<300，go盒子消失，顶部盒子移动到距离顶部-60px，相当于隐藏掉
        go.style.opacity = 0;
    };
};
